<template>
    <div> 
        <p>
            <el-input v-model="query.phone" style="width: 240px" placeholder="输入手机号" />
            <span>{{ meg }}</span>
        </p>
        <p>
            <el-input v-model="query.pwd" style="width: 240px" type="password" placeholder="输入密码" show-password/>
        </p>
        <el-button @click="Login_pp">登录</el-button>
    </div>
</template>


<script setup lang='ts' name=''>
import {ref} from 'vue'
import axios from 'axios'
import {useRouter,useRoute} from 'vue-router'

let router = useRouter()

// 数据
let query = ref({
    phone:"",
    pwd:""
})
let meg = ref("")


// 方法
function Login_pp(){
    axios.post(`http://127.0.0.1:8000/user/list/vaphone/`,query.value)
    .then((res) => {
        // console.log(res);
        meg.value = res.data.message
        if (res.data.status == 200){
            router.push({
                path:"/news"
            })
        }
    }).catch((err) => {
        console.log(err);
        
    });
}



</script>


<style scoped> 

</style>